package com.atguigu.daijia.driver.client;

import com.atguigu.daijia.common.result.Result;
import com.atguigu.daijia.model.entity.driver.DriverSet;
import com.atguigu.daijia.model.form.driver.DriverFaceModelForm;
import com.atguigu.daijia.model.form.driver.UpdateDriverAuthInfoForm;
import com.atguigu.daijia.model.vo.driver.DriverAuthInfoVo;
import com.atguigu.daijia.model.vo.driver.DriverInfoVo;
import com.atguigu.daijia.model.vo.driver.DriverLoginVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author 山顶洞人郑某
 * @className DriverInfoFeignClientFallback.java
 * @date 2024 09 05
 */
@Component
@Slf4j
public class DriverInfoFeignClientFallback implements FallbackFactory<DriverInfoFeignClient> {
    @Override
    public DriverInfoFeignClient create(Throwable cause) {
        return new DriverInfoFeignClient() {
            @Override
            public Result<Long> wxLogin(String code) {
                log.info("司机登录服务调用失败");
                return Result.fail();
            }

            @Override
            public Result<DriverLoginVo> getDriverLoginInfo(Long userId) {
                return Result.fail();
            }

            /**
             * 获取司机认证信息
             *
             * @param driverId
             * @return
             */
            @Override
            public Result<DriverAuthInfoVo> getDriverAuthInfo(Long driverId) {
                return Result.fail();
            }

            @Override
            public Result<Boolean> updateAuthInfo(UpdateDriverAuthInfoForm updateDriverAuthInfoForm) {
                return Result.fail();
            }

            /**
             * 创建司机人脸模型
             *
             * @param driverFaceModelForm
             * @return
             */
            @Override
            public Result<Boolean> creatDriverFaceModel(DriverFaceModelForm driverFaceModelForm) {
                return Result.fail();
            }

            /**
             * 获取司机设置信息
             *
             * @param driverId
             * @return
             */
            @Override
            public Result<DriverSet> getDriverSet(Long driverId) {
                return Result.fail();
            }

            /**
             * 判断司机当日是否进行过人脸识别
             *
             * @param driverId
             * @return
             */
            @Override
            public Result<Boolean> isFaceRecognition(Long driverId) {
                return Result.fail();
            }

            /**
             * 验证司机人脸
             *
             * @param driverFaceModelForm
             * @return
             */
            @Override
            public Result<Boolean> verifyDriverFace(DriverFaceModelForm driverFaceModelForm) {
                return Result.fail();
            }

            /**
             * 更新司机接单状态
             *
             * @param driverId
             * @param status
             */
            @Override
            public Result<Boolean> updateServiceStatus(Long driverId, int status) {
                return Result.ok();
            }

            /**
             * 获取司机基本信息
             *
             * @param driverId
             * @return
             */
            @Override
            public Result<DriverInfoVo> getDriverInfo(Long driverId) {
                return Result.fail();
            }
        };
    }
}
